package com.starry.compose_study.state.two

import android.app.Activity
import android.os.Bundle
import androidx.core.widget.doAfterTextChanged
import com.starry.compose_study.databinding.ActivityUnStructureBinding

class UnStructureActivity : Activity() {

    private val binding by lazy {
        ActivityUnStructureBinding.inflate(layoutInflater)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(binding.root)

        binding.editTextText.doAfterTextChanged { text ->

            updateHello(text.toString())
        }
    }

    private fun updateHello(string: String) {
        binding.textView.text = "$string"
    }
}
